package com.photohistory.hibernate.beans;
// Generated 31.03.2010 18:43:35 by Hibernate Tools 3.2.4.GA


import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * User generated by hbm2java
 */
@Entity
@Table(name="user"
    ,catalog="mytest"
)
public class User  implements java.io.Serializable {


     private Integer id;
     private String name;
     private String surname;
     private String nickname;
     private int countryId;
     private Integer cityId;
     private Integer townId;
     private Date birthday;
     private Integer streetId;
     private Integer doorNr;
     private Integer postcode;
     private Set<Photo> photos = new HashSet<Photo>(0);
     private Set<Comment> comments = new HashSet<Comment>(0);
     private Set<ManageFollow> manageFollowsForUserFollowed = new HashSet<ManageFollow>(0);
     private Set<Rating> ratings = new HashSet<Rating>(0);
     private Set<ManageFollow> manageFollowsForUserFollowing = new HashSet<ManageFollow>(0);

    public User() {
    }

	
    public User(String name, String surname, String nickname, int countryId, Date birthday) {
        this.name = name;
        this.surname = surname;
        this.nickname = nickname;
        this.countryId = countryId;
        this.birthday = birthday;
    }
    public User(String name, String surname, String nickname, int countryId, Integer cityId, Integer townId, Date birthday, Integer streetId, Integer doorNr, Integer postcode, Set<Photo> photos, Set<Comment> comments, Set<ManageFollow> manageFollowsForUserFollowed, Set<Rating> ratings, Set<ManageFollow> manageFollowsForUserFollowing) {
       this.name = name;
       this.surname = surname;
       this.nickname = nickname;
       this.countryId = countryId;
       this.cityId = cityId;
       this.townId = townId;
       this.birthday = birthday;
       this.streetId = streetId;
       this.doorNr = doorNr;
       this.postcode = postcode;
       this.photos = photos;
       this.comments = comments;
       this.manageFollowsForUserFollowed = manageFollowsForUserFollowed;
       this.ratings = ratings;
       this.manageFollowsForUserFollowing = manageFollowsForUserFollowing;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)

    
    @Column(name="id", unique=true, nullable=false)
    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }

    
    @Column(name="name", nullable=false, length=40)
    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }

    
    @Column(name="surname", nullable=false, length=40)
    public String getSurname() {
        return this.surname;
    }
    
    public void setSurname(String surname) {
        this.surname = surname;
    }

    
    @Column(name="nickname", nullable=false, length=40)
    public String getNickname() {
        return this.nickname;
    }
    
    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    
    @Column(name="country_id", nullable=false)
    public int getCountryId() {
        return this.countryId;
    }
    
    public void setCountryId(int countryId) {
        this.countryId = countryId;
    }

    
    @Column(name="city_id")
    public Integer getCityId() {
        return this.cityId;
    }
    
    public void setCityId(Integer cityId) {
        this.cityId = cityId;
    }

    
    @Column(name="town_id")
    public Integer getTownId() {
        return this.townId;
    }
    
    public void setTownId(Integer townId) {
        this.townId = townId;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="birthday", nullable=false, length=10)
    public Date getBirthday() {
        return this.birthday;
    }
    
    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    
    @Column(name="street_id")
    public Integer getStreetId() {
        return this.streetId;
    }
    
    public void setStreetId(Integer streetId) {
        this.streetId = streetId;
    }

    
    @Column(name="door_nr")
    public Integer getDoorNr() {
        return this.doorNr;
    }
    
    public void setDoorNr(Integer doorNr) {
        this.doorNr = doorNr;
    }

    
    @Column(name="postcode")
    public Integer getPostcode() {
        return this.postcode;
    }
    
    public void setPostcode(Integer postcode) {
        this.postcode = postcode;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="user")
    public Set<Photo> getPhotos() {
        return this.photos;
    }
    
    public void setPhotos(Set<Photo> photos) {
        this.photos = photos;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="user")
    public Set<Comment> getComments() {
        return this.comments;
    }
    
    public void setComments(Set<Comment> comments) {
        this.comments = comments;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="userByUserFollowed")
    public Set<ManageFollow> getManageFollowsForUserFollowed() {
        return this.manageFollowsForUserFollowed;
    }
    
    public void setManageFollowsForUserFollowed(Set<ManageFollow> manageFollowsForUserFollowed) {
        this.manageFollowsForUserFollowed = manageFollowsForUserFollowed;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="user")
    public Set<Rating> getRatings() {
        return this.ratings;
    }
    
    public void setRatings(Set<Rating> ratings) {
        this.ratings = ratings;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="userByUserFollowing")
    public Set<ManageFollow> getManageFollowsForUserFollowing() {
        return this.manageFollowsForUserFollowing;
    }
    
    public void setManageFollowsForUserFollowing(Set<ManageFollow> manageFollowsForUserFollowing) {
        this.manageFollowsForUserFollowing = manageFollowsForUserFollowing;
    }

    public String toString(){
    	
    	return name;
    }


}


